
import java.sql.SQLException;
import java.util.Vector;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 *
 * @author Dakalo
 */
public class RenameParameterAccess 
{
    Database data;
 
    /**
     * The default constructor. This constructor will connect to a database named infinitysolutions with username: root and password: root
     */    
    RenameParameterAccess() throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
    {
        data = new Database();
        data.connect();
    }
    
    
    /**
     * The constructor that allows connection to any database
     * @param dataBaseName String. The database's name
     * @param userName String. The username for the database user
     * @param passWord String. The password for the database user
     */    
    RenameParameterAccess(String dataBaseName, String userName, String passWord) throws InstantiationException, IllegalAccessException, ClassNotFoundException, SQLException
    {
        data = new Database();
        data.connect();
    }
    
    /**
     * The constructor that allows connection to infinitysolutions database
     * @param userName String. The username for the database user
     * @param passWord String. The password for the database user
     */    
    RenameParameterAccess(String userName, String passWord) throws SQLException, InstantiationException, IllegalAccessException, ClassNotFoundException
    {
        data = new Database();
        data.connect();
    }     
    /**
     * The globalConflict method,Checks if the is a conflict on the new name and the global names
     * @return a boolean
     * @param newName String. The new name which the user entered
     */
    public boolean globalConflict(String newName)
    {
        return data.globalConflict(newName);
    }  
 
     /**
     * The searchParameter method,Returns an array of line numbers of parameters
     * @return a vector of integers
     * @param parameterName String. The parameter name to to search
     */
    public Vector<Integer> searchParameter(String parameterName)
    {
        return data.searchParameter(parameterName);
    }
    /**
     * The globalVariables method,Gets the global variables of the class
     * @return a Vector of Strings
     * @param className String. The className to get the global variables of
     */
    public Vector<String> globalVariables(String className)
    {
        return data.globalVariables(className);
    }    

}
